﻿
Imports elpmis

Public Class requestProcessor
    Inherits Global.requestProcessor

    Private path As String = Nothing
    Private app As lpmsmonitor = Nothing

    Public Overrides Function pathidentity() As String
        Dim rtn As String = Nothing
        If lpmsmonitor.invokepath(app, rtn) Then
            Return rtn
        Else
            Return path
        End If
    End Function

    Public Overrides Sub initial(Optional ByVal config As configParser = Nothing)
        MyBase.initial(config)
        lpmsmonitor.invokeinitial(app, config)
    End Sub

    Public Overrides Function process(ByVal context As httpContext) As Boolean
        If Not lpmsmonitor.invokeprocess(app) Then
            Return False
        End If
        lpmsmonitor.invokeheader(app, context)
        Return True
    End Function

    Public Sub New(ByVal path As String, ByVal scriptfile As String)
        MyBase.new()
        copy(Me.path, path)
        app = New lpmsmonitor(scriptfile)
    End Sub
End Class
